package com.fzkj.timer;

import java.util.Timer;
import java.util.TimerTask;

public class MyTimerTask extends TimerTask {

    private int time = 1213;
    private Timer timer;
    public MyTimerTask(Timer timer){
        this.timer = timer;
    }

    @Override
    public void run() {
        System.out.println("timer线程执行完成");
        timer.cancel();
    }
}
